<?php
$taskId = $_GET['task_id'];
$dns = "sqlsrv:Server=LAPTOP-LD8O4C6L\SQLEXPRESS;Database=TaskManagement";
$db = new PDO($dns,"sa","123456");
$sql = "delete from TaskList where TaskId ='{$taskId}'";
$result = $db->exec($sql);
if ($result){
    echo "删除成功.<a href=\"task_list.php\">返回任务列表</a>";
}else{
    echo "删除失败";
}
?>